package engine.fov;

import java.awt.Point;

/**
 * A class encapsulating a 2D point, as integers (Reason for existence: java.awt.Point uses double
 * and I wanted speed.)
 * 
 * @author sdatta
 */
@SuppressWarnings("serial")
public class Point2I extends Point {

	/**
	 * @param x
	 *            the x-coordinate of this point
	 * @param y
	 *            the y-coordinate of this point
	 */
	public Point2I(int x, int y) {
		this.x = x;
		this.y = y;
	}

	/**
	 * Uses x+y as hash
	 */
	@Override
	public int hashCode() {
		return x << 7 - x + y;// x*prime+y
	}

	@Override
	public String toString() {
		return "Point2I[ " + x + ", " + y + " ]";
	}
}
